package chat.aylan.top;
/*
 * @Author Abduahad
 * @Description 程序入口
 * @Date 2019-01-10
 */
import chat.aylan.top.service.ServerThread;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.ArrayList;
import java.util.List;

public class Main {
    public static List<ServerThread> list = new ArrayList<>();
    public static void main(String[] args) {
        try {
            ServerSocket serverSocket = new ServerSocket(10001);
            while (true){
                Socket socket = serverSocket.accept();
                ServerThread serverThread = new ServerThread(socket);
                new Thread(serverThread).start();
                list.add(serverThread);
            }
        } catch (IOException e) {
           e.printStackTrace();
        }
    }
}
